package com.tsd.jxc.sale.dao;

import com.tsd.common.vo.BatchDeleteLogicVo;
import com.tsd.core.vo.PageBean;
import com.tsd.jxc.sale.entity.JxcSaleOrderDetail;
import com.tsd.jxc.sale.entity.JxcSaleOrderDetailExt;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 描述：JxcSaleOrderDetailMapper
 *
 * @author Hillpool
 * @date 2022/07/29 15:04:33
 */
public interface JxcSaleOrderDetailMapper {

    JxcSaleOrderDetail selectByPrimaryKey(Long id);

    JxcSaleOrderDetailExt selectBySid(String sid);

    int deleteByPrimaryKey(Long id);

    int insert(JxcSaleOrderDetail record);

    int insertSelective(JxcSaleOrderDetail record);

    int insertList(@Param("list") List<JxcSaleOrderDetailExt> list);

    int updateByPrimaryKey(JxcSaleOrderDetail record);

    int updateByPrimaryKeySelective(JxcSaleOrderDetail record);

    int updateList(@Param("list") List<JxcSaleOrderDetailExt> list);

    List<JxcSaleOrderDetailExt> selectByEntity(JxcSaleOrderDetailExt record);

    List<JxcSaleOrderDetailExt> selectByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<JxcSaleOrderDetailExt> selectCount1Page(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<JxcSaleOrderDetailExt> selectByParams(@Param("params") Map<String, Object> params);

    int deleteLogicByIdList(BatchDeleteLogicVo logicVo);

    int deleteLogicByOrderList(BatchDeleteLogicVo logicVo);

    int updateReturnInfo(@Param("sale_order_detail_sid_list") List<String> sale_order_detail_sid_list);

    int restoreOutBill(@Param("out_bill_list") List<String> out_bill_list);

    JxcSaleOrderDetailExt checkStockQty4GenOutBill(@Param("order_list") List<String> order_list);

    List<JxcSaleOrderDetailExt> select4Sale2Buy(@Param("sale_order_list") List<String> sale_order_list, @Param("sale_order_detail_list") List<String> sale_order_detail_list);

    List<JxcSaleOrderDetailExt> selectBuyInfo(@Param("list")List<JxcSaleOrderDetailExt> list);

    List<JxcSaleOrderDetailExt> selectValid4ReturnByPage(@Param("params") Map<String, Object> params, @Param("page") PageBean page);

    List<JxcSaleOrderDetailExt> selectByOrderSid(@Param("order_sid") String order_sid);

    List<JxcSaleOrderDetailExt> selectBySids(@Param("sids") List<String> sids);

    int updateBuyQtyByBuyOrderList(@Param("buy_order_list") List<String> buy_order_list);

    int updateCutAmountBySidList(@Param("sid_list") List<String> sid_list);

    int updateQty4BaseByOrderSid(@Param("order_sid") String order_sid);
}
